<?php

namespace app\sisome\controller;

use think\Controller;

class Profit extends Common
{
	public function tgsy()
	{			//KM++推广收益明细
		$a = 1;
		$b = 2;
		if (isset($_GET['user'])) {
			$map['uname'] = $_GET['user'];
		}
		$map['datatype'] = array(array('eq', $a), array('eq', $b), 'or');

		$total = db('userget')->where($map)->sum('money');
		$list = db('userget')->where($map)->order('ID DESC')->paginate(20);
		$this->assign('lists', $list); // 賦值數據集
		$this->assign('total', $total);
		return view();
	}
	public function kcsy()
	{			//KM++矿车收益明细
        $map =[];
		if (isset($_GET['user'])) {
			$map['uname'] = $_GET['user'];
		}

		//$map['datatype'] = 0;
		$list = db('userget')->where($map)->order('ID DESC')->paginate(20);
		$total = db('userget')->where($map)->sum('money');
		$this->assign('total', $total);
		$this->assign('lists', $list); // 賦值數據集
		return view();
	}
}
